package com.kede.dao;

import com.kede.entity.Role;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 【请填写作者】
 * @since 2020-04-11
 */
@Repository
public interface RoleDao extends BaseMapper<Role> {
    @Select("SELECT ar.* FROM role ar LEFT JOIN user_role aur ON ar.id=aur.role_id WHERE aur.user_id=#{uid}")
    List<Role> getListByUserId(@Param("uid") Long id);
}
